<template>
	<view class="customer">
		<view class="title">
			<view class="leftIndex">
			</view>
			<text class="Info font2">
				请填写客户信息
			</text>
		</view>
		<view class="subInfo">
			<u--form labelPosition="left" :model="formData" :rules="rules" ref="form1">
				<u-form-item label="姓名" prop="project_name" ref="item1" labelWidth="100" labelPosition="left">
					<u--input v-model="formData.project_name" border="none" placeholder="请输入项目名称"></u--input>
				</u-form-item>
				<u-form-item label="客户电话" prop="project_leader" ref="item1" labelWidth="100" labelPosition="left">
					<u--input v-model="formData.project_leader" border="none" placeholder="请输入电话号码"></u--input>
				</u-form-item>
				<u-form-item label="预计到访时间" labelWidth="100" prop="type_name" @click="hideKeyboard();popupShow = true;"
					ref="item1">
					<vvSelect placeholder="请选择项目类型" class="select" :list="type_list" label="name" valueKey="type_id"
						:name="formData.type_name" ref="vvSelect1" @change="pickerChange" v-model="formData.type_id">
					</vvSelect>
					<u-icon slot="right" name="arrow-right"></u-icon>
				</u-form-item>
				<u-form-item label="店铺分类" labelWidth="100" prop="type_name" @click="hideKeyboard();popupShow = true;"
					ref="item1">
					<vvSelect placeholder="请选择项目类型" class="select" :list="type_list" label="name" valueKey="type_id"
						:name="formData.type_name" ref="vvSelect1" @change="pickerChange" v-model="formData.type_id">
					</vvSelect>
					<u-icon slot="right" name="arrow-right"></u-icon>
				</u-form-item>
				<view class="cusNeed">
					<u-form-item label="客户需求" prop="project_content" :borderBottom="false" ref="item1" labelWidth="100"
						labelPosition="top" class="">
						<u--textarea placeholder="请输入项目内容" v-model="formData.project_content" :count="false" autoHeight
							maxlength="-1" height="100">
						</u--textarea>
					</u-form-item>
				</view>
			</u--form>
			<view class="addpro">
				<u-button class="custom-style" text="提交"
					customStyle="background: linear-gradient(90deg, #0873DE 0%, #C7EACE 100%);color:#fff;margin-top:20px;border-radius: 30px;"
					@click="goAuth">
				</u-button>
			</view>
		</view>
	</view>
</template>
<script>
	import centerShow from '@/components/common/centerShow.vue'
	import vvSelect from '@/components/vv-select/vv-select.vue'
	export default {
		data() {
			return {
				sel: true,
				List: [{
					name: '协议'
				}],
				active: 0, // 选中协议与否
				showBottom: false,
				showCenter: false,
				logImgArr: [],
				imgArr: [],
				tip: '',
				actions: [{
						name: '男',
					},
					{
						name: '女',
					},
					{
						name: '保密',
					},
				],
				formData: {
					project_leader: '', //项目负责人
					project_name: '', //项目名称
					project_no: '', //项目编号
					pocket_unit: '', //兜底单位
					status: "1", //完成状态 完成状态  1=未开始,2=进行中,3=已完成
					project_content: '', //项目内容
					project_pics: '', //图片
					project_priority: '2', //项目推进优先级 项目推进优先级 1=正常推进,2=优先推进
					project_logo: '', //项目logo
					is_lx: '1', //是否立项 1是 0否
					type_id: '', //项目类型id
					type_name: '', //类型名称
					subject_name: '', //主体名称
					subject_id: '', //主体id
				},
				gacadeUp: [
					// {
					// 	url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
					// },
					// {
					// 	url: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
					// },
				],
				typeStatus: false,
				type_list: [],
				subject_list: [],
				is_lx: [],
				showSubject: false,
				radiolist1: [{
						name: '优先推进',
						value: 2,
						disabled: false
					},
					{
						name: '正常推进',
						value: 1,
						disabled: false
					}
				],
				radiovalue3: '未开始',
				radiolist3: [{
						name: '未开始',
						value: '1',
						disabled: false
					}, {
						name: '进行中',
						value: '2',
						disabled: false
					},
					{
						name: '已完成',
						value: '3',
						disabled: false
					}
				],
				radiovalue2: '是',
				radiolist2: [{
						name: '是',
						value: 1,
						disabled: false
					},
					{
						name: '否',
						value: 0,
						disabled: false
					}
				],
				radiovalue1: '优先推进',
				rules: {
					'subject_name': {
						type: 'string',
						required: true,
						message: '请选择主体',
						trigger: ['blur', 'change']
					},
					'type_name': {
						type: 'string',
						required: true,
						message: '请选择项目类型',
						trigger: ['blur', 'change']
					},
					'project_no': {
						type: 'string',
						required: true,
						message: '请填写项目编号',
						trigger: ['blur', 'change']
					},
					intro: {
						type: 'string',
						min: 3,
						required: true,
						message: '不低于3个字',
						trigger: ['change']
					},
					'project_name': {
						type: 'string',
						required: true,
						message: '请填写项目名称',
						trigger: ['blur', 'change']
					},
					'project_leader': {
						type: 'string',
						required: true,
						message: '请填写项目负责人',
						trigger: ['blur', 'change']
					},
					'pocket_unit': {
						type: 'string',
						required: true,
						message: '请填写兜底单位',
						trigger: ['blur', 'change']
					},
					'project_content': {
						type: 'string',
						required: true,
						message: '请填写内容',
						trigger: ['blur', 'change']
					},
				},
				userInfo: {},
				popupShow: false
			};
		},
		methods: {

		},
		onReady() {
			//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
			this.$nextTick(() => {
				// 在此处执行你要执行的函数
				this.$refs.form1.setRules(this.rules)
			});
		},
	};
</script>
<style lang="scss" scoped>
	::v-deep .u-form-item__body__right {
		margin-top: 25rpx !important;
	}
    // ::v-deep .u-form-item__body__right {
    // 	font-size: 30rpx !important;
    // 	color: #505050;
    // }
	.customer {
		margin: 20rpx;
		.title {
			background: rgba(0, 213, 206, 0.15);
			height: 45px;
			line-height: 45px;
			display: flex;
			align-items: center;
			font-weight: 600;

			.leftIndex {
				width: 4rpx;
				height: 34rpx;
				background: #0873DE;
				margin: 0 15rpx;
			}

			.Info {}
		}

		.subInfo {
			padding: 20rpx;
		}
	}
</style>
